﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jhong.FunMVC
{
    public class RouteTable
    {

        private static IList<RouteBase> _routes;

        private static object _lock = new object();


        static RouteTable()
        {
            _routes = new List<RouteBase>();
        }

        public static IList<RouteBase> Routes
        {
            get
            {
                return _routes;
            }
        }

        public static void MapRoute(string name, string url, object defaults)
        {
            lock (_lock)
            {
                _routes.Add(new RouteBase(name, url, defaults));
            }
        }
    }
}
